package com.yungu.swift.admin.route.test;

import com.alibaba.dubbo.config.annotation.Reference;
import com.yungu.swift.base.ResponseData;
import com.yungu.swift.order.service.AliPayCashService;
import com.yungu.swift.order.service.PayService;
import com.yungu.swift.order.service.WxPayCashService;
import com.yungu.swift.order.service.WxToBankService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author cuixiuyin@yungu-link.com
 * @Date 2020-08-19 13:06
 * @Description 1.0
 */
@Controller
@RequestMapping("/data/repair")
public class DataRepair {

    @Reference
    private PayService payService;
    @Reference
    private AliPayCashService aliPayCashService;
    @Reference
    private WxPayCashService wxPayCashService;
    @Reference
    private WxToBankService wxToBankService;

    @GetMapping("/pay/{serialNumber}")
    @ResponseBody
    public ResponseData<Boolean> payDataRepair(@PathVariable String serialNumber) {
        return payService.repairData(serialNumber);
    }

    @GetMapping("/cash/ali/{uuid}")
    @ResponseBody
    public ResponseData<Boolean> aliCashDataRepqir(@PathVariable String uuid) {
        return aliPayCashService.dataRepair(uuid);
    }

    @GetMapping("/cash/wx/{uuid}")
    @ResponseBody
    public ResponseData<Boolean> wxCashDataRepqir(@PathVariable String uuid) {
        return wxPayCashService.dataRepair(uuid);
    }

    @GetMapping("/cash/bank/{uuid}")
    @ResponseBody
    public ResponseData<Boolean> bankCashDataRepqir(@PathVariable String uuid) {
        return wxToBankService.dataRepair(uuid);
    }
}
